﻿@using System.Data
@using ZoomLa.Common
@model ZoomLa.SQLDAL.SQL.PageSetting
@{
    Model.cols = 8;
}
@functions{
    public string GetStuType(int stutype)
    {
        switch (stutype)
        {
            case 1:
                return "学生";
            case 2:
                return "教师";
            case 3:
                return "家长";
            default:
                return "管理员";
        }
    }
    public string GetStatus(int Auditing)
    {
        switch (Auditing)
        {
            case -1:
                return "<span style='color:gray'>无需审核</span>";
            case 0:
                return "<span style='color:red'>未审核</span>";
            case 1:
                return "<span style='color:green'>已审核</span>";
            default:
                return "";
        }
    }
}
<table id="EGV" class="table table-striped table-bordered table-hover margin_t5">
    <tr><th></th><th>ID</th><th>成员名称</th><th>成员角色</th><th>申请时间</th><th>状态</th><th>申请备注</th><th>操作</th></tr>
    @foreach (DataRow dr in Model.dt.Rows)
    {
        <tr>
            <td><input type="checkbox" name="idchk" value="@dr["NoteID"]" /></td>
            <td>@dr["NoteID"]</td>
            <td>@dr["UserName"]</td>
            <td>@GetStuType(DataConverter.CLng(dr["StudentType"]))</td>
            <td>@DataConverter.CDate(dr["AddTime"]).ToString("yyyy-MM-dd HH:mm")</td>
            <td>@MvcHtmlString.Create(GetStatus(DataConverter.CLng(dr["Auditing"])))</td>
            <td>@dr["AuditingContext"]</td>
            <td>
                @switch (DataConverter.CLng(dr["Auditing"]))
                {
                    case 0:
                        <a href="javascript:;" onclick='mvcpage.del({url: "Student_Audit", ids: @dr["NoteID"]});' class="option_style">审核</a>
                        break;
                    case 1:
                        <a href="javascript:;" onclick='mvcpage.del({url: "Student_UnAudit", ids: @dr["NoteID"]});' class="option_style">拒绝</a>
                        break;
                }
                <a href="javascript:;" onclick='mvcpage.del({url: "Student_Del", ids: @dr["NoteID"]});' class="option_style"><i class="fa fa-trash"></i>删除</a>
            </td>
        </tr>
    }
    @Html.Partial("_page", Model)
</table>